﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TvTipper.Entities
{
    public class TvProgramMetadata : RankableEntity
    {
        public virtual string Name { get; protected internal set; }
        
        public virtual int? StartYear 
        {
            get
            {
                return string.IsNullOrEmpty(StartYearStr) ? (int?)null : Int32.Parse(StartYearStr);
            }
            set
            {
                StartYearStr = value == null ? "" : value.ToString();
                NotifyPropertyChanged("StartYear");
            }
        }

        public virtual int? EndYear
        {
            get
            {
                return string.IsNullOrEmpty(EndYearStr) ? (int?)null : Int32.Parse(EndYearStr);
            }
            set
            {
                EndYearStr = value == null ? "" : value.ToString();
                NotifyPropertyChanged("EndYear");
            }
        }

        protected internal virtual string StartYearStr { get; set; }
        protected internal virtual string EndYearStr { get; set; }
    }
}
